from django.conf.urls.defaults import *
from django.view.generic.list_detail import object_list
from pennypress.apps.categories.models import Category, CategoryBase
from pennypress.apps.categories.views import category_list, category_detail, category_archive_day,\
        category_archive_month, category_archive_year, category_latest

info_dict = {
    'queryset':CategoryBase.active_abjects.all(),
    'date_field': 'publish_date',
    'paginate_by': 25,
}

urlpatterns = patterns('',
    url(r'^(?P<category>[\w_/\-]+)(?P<year>\d{4})/(?P<month>[A-Za-z]{3})/(?P<day>\d{1,2})/$', category_archive_day, info_dict, name='category_archive_day'),
    url(r'^(?P<category>[\w_/\-]+)(?P<year>\d{4})/(?P<month>[A-Za-z]{3})/$', category_archive_month, info_dict, name='category_archive_month'),
    url(r'^(?P<category>[\w_/\-]+)(?P<year>\d{4})/$', category_archive_year, info_dict, name='category_archive_year'),
    url(r'^(?P<category>[\w_/\-]+/)latest/$', category_latest, info_dict, name='category_latest'),
    url(r'^(?P<category>[\w_/\-]+/)$', category_detail, info_dict, name='category_detail'),
    url(r'^$', object_list, {'queryset':Category.objects.all()}, name='category_list'),
)
